<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/style.css"/>
		<style>
			.mui-content{
				line-height: 1.3em;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">提现记录</h1>
		</header>
		<div class="mui-content">
			<ul id="list" class="mui-table-view mui-table-view-striped mui-table-view-condensed">
		        
		   </ul>
		</div>
		<script src="js/mui.min.js"></script>
		<script src="js/app.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/parseTemplate.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/resources.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/html" id="tplList">
			<# var item;for(var i=0 ; i < data.length; i++) { item=data[i]; #>
			<li class="mui-table-view-cell" data-id="<#= item.WithdrawID #>">
		            <div class="mui-table">
		                <div class="mui-table-cell mui-col-xs-8">
		                	<div><#= app.getMyBankCard(item) #></div>
		                    <div class="mui-h5"><#= item.CreateTime #></div>
		                </div>
		                <div class="mui-table-cell mui-col-xs-4 mui-text-right">
		                    <h4>- <#= app.fmoney(item.WithdrawAmount) #></h4>
		                    <h5><#= resources.GetWithdrawStatus(item.Status) #></h5>
		                </div>
		            </div>
		        </li>
		    <#}#>
		</script>
		<script type="text/javascript">
			mui.init();
			
			var tpl = document.getElementById("tplList").innerHTML;
			var $list = document.getElementById("list"); 
			var dataList;
			
			mui("#list").on('tap', 'li', function(){	
				var id = this.getAttribute("data-id");
				mui.openWindow({url:"account-out-item.html", id:"account-out-item", extras:{ data: getItemData(id) }});
			});
			
			getItemData = function(id){
				console.log(JSON.stringify(dataList));
				var f = dataList.data.filter(function(item) {
					return item.WithdrawID == id;
				});
				return f.length > 0 ? f[0] : null;
			};
			
			mui.plusReady(function(){
				app.post("GetWithdrawList", {}, function(data){
					$list.innerHTML = parseTemplate(tpl, data);
					dataList = data;
				});
			});
		</script>
	</body>

</html>